{include file="header.html"}

<div class="page-header">
	<h6>
		会员管理
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			会员详情
		</small>
	</h6>
</div><!-- /.page-header -->
<div class="row">
<div class="col-xs-12">
	<form class="form-horizontal" role="form" method="post" action="?app=member&act=save">
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="id"> ID </label>
			<div class="col-sm-10">
				<input type="text" id="id" name="id" readonly value="{$row->id}" class="col-xs-1" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="nick_name"> 昵称 </label>
			<div class="col-sm-10">
				<input type="text" id="nick_name" name="nick_name" value="{$row->nick_name}" class="col-xs-6" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right"> 头像 </label>
			<div class="col-sm-10">
				<!-- <input type="file" id="avatar" name="avatar" value="{$row->avatar}" class="col-xs-6" /> -->
				<img src="{if $row->avatar !== ''}{$row->avatar}{else}/images/avatar.jpg{/if}" width="50" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="mobile"> 手机号码 </label>
			<div class="col-sm-10">
				<input type="text" id="mobile" name="mobile" value="{$row->mobile}" class="col-xs-6" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="qq"> QQ </label>
			<div class="col-sm-10">
				<input type="text" id="qq" name="qq" value="{$row->qq}" class="col-xs-6" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="money"> 余额 </label>
			<div class="col-sm-10">
				<input type="text" id="money" name="money" value="{$row->money}" class="col-xs-6" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="commission"> 佣金收入</label>
			<div class="col-sm-10">
				<input type="text" id="commission" name="commission" value="{$row->commission}" class="col-xs-4" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="integral"> 积分 </label>
			<div class="col-sm-10">
				<input type="text" id="integral" name="integral" value="{$row->integral}" readonly class="col-xs-6" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="status"> 状态 </label>
			<div class="col-sm-10">
				<div class="radio">
					<label>
						<input {if $row->status==1}checked{/if} value="1" name="status" type="radio" class="ace" />
						<span class="lbl"> 正常</span>
					</label>
				</div>
				<div class="radio">
					<label>
						<input {if $row->status==0}checked{/if} value="0" name="status" type="radio" class="ace" />
						<span class="lbl"> 冻结</span>
					</label>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="invite_code"> 邀请码 </label>
			<div class="col-sm-10">
				<input type="text" id="invite_code" name="invite_code" readonly value="{$row->invite_code}" class="col-xs-6" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="logins"> 登录次数 </label>
			<div class="col-sm-10">
				<input type="text" id="logins" name="logins" readonly value="{$row->logins}" class="col-xs-4" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="reg_time"> 注册时间 </label>
			<div class="col-sm-10">
				<input type="text" id="reg_time" name="reg_time" readonly value='{$row->reg_time|date_format:"%Y-%m-%d %H:%I:%S"}' class="col-xs-6" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="reg_ip"> 注册IP </label>
			<div class="col-sm-10">
				<input type="text" id="reg_ip" name="reg_ip" readonly value="{$row->reg_ip}" class="col-xs-6" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="last_time"> 上次登录时间 </label>
			<div class="col-sm-10">
				<input type="text" id="last_time" name="last_time" readonly value='{$row->last_time|date_format:"%Y-%m-%d %H:%I:%S"}' class="col-xs-6" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="last_ip"> 上次登录IP </label>
			<div class="col-sm-10">
				<input type="text" id="last_ip" name="last_ip" readonly value="{$row->last_ip}" class="col-xs-6" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="udid"> sign/udid </label>
			<div class="col-sm-10">
				<input type="text" id="udid" name="udid" readonly value="{$row->sign}/{$row->udid}" class="col-xs-10 col-sm-5" />
			</div>
		</div>

		<!-- <div class="form-group">
			<label class="col-sm-2 control-label no-padding-right"> 套餐记录 </label>
			<div class="col-sm-10">
				<table width="100%">
				{if $meals}
					{foreach from=$meals name=meal item=meal}
					<tr><td>{$meal->name}(剩余：<font color=red>{$meal->num}</font> 次)</td></tr>
					{/foreach}
				{/if}
				</table>
			</div>
		</div> -->

		<!-- <div class="form-group">
			<label class="col-sm-2 control-label no-padding-right"> 现金券 </label>
			<div class="col-sm-10">
				{if $coupons}
					<table width="100%" border="1">
					<tr height="25"><td>现金券名称</td><td>面值</td><td>领取时间</td><td>失效时间</td><td>使用时间</td></tr>
					{foreach from=$coupons name=coupon item=coupon}
					<tr height="25">
						<td>{$coupon->cash_coupon_name}</td>
						<td>{$coupon->face_value}</td>
						<td>{$coupon->add_time|date_format:"%Y-%m-%d %H:%M:%S"}</td>
						<td>{$coupon->expiring_time|date_format:"%Y-%m-%d"}</td>
						<td>{if $coupon->used_time}
							{$coupon->used_time|date_format:"%Y-%m-%d %H:%M:%S"} 
							{else}
							未使用
							{/if}</td>
					</tr>
					{/foreach}
					</table>
				{else}
					<div align="right"><a href="javascript:void(0)" onclick="javascript:if (confirm('确定给该会员发放现金券？')) { self.location='?app=cash_coupon&act=send&member_id={$row->id}'; }">给TA发放现金券</a></div>
				{/if}
				
			</div>
		</div> -->

		<div class="clearfix form-actions">
			<div class="col-md-offset-3 col-md-9">
				<button class="btn btn-info" type="submit">
					<i class="ace-icon fa fa-check bigger-110"></i>
					提交
				</button>

				&nbsp; &nbsp; &nbsp;
				<button class="btn" type="reset">
					<i class="ace-icon fa fa-undo bigger-110"></i>
					重置
				</button>
			</div>
		</div>
	</form>
</div>
</div>

{include file="footer.html"}
<script type="text/javascript">
	$(function(){
		if({$row->member_type} !== 2){
			$('#dianzhang').hide();
		}
		if({$row->member_type} !== 3){
			$('#dianpu').hide();
		}
		$('#member_type').blur(function(){
			var a =$(this).val();
			if(a == 2){
				$('#dianzhang').show();
			}else{
				$('#dianzhang').hide();
			}
			if(a == 3){
				$('#dianpu').show();
			}else{
				$('#dianpu').hide();
			}
		})
	})
</script>